package com.kylin.module.searchdisk.bussiness;

import org.apache.log4j.Logger;

import com.kylin.common.exception.BusinessException;
import com.kylin.common.paginate.DisplayPage;
import com.kylin.common.paginate.PageManager;
import com.kylin.hibernate.BaseHibernateDAO;
import com.kylin.hibernate.CriteriaInfo;
import com.kylin.module.shop.orm.Searchdisk;

public class SearchdiskBlogic {
	protected Logger Log = Logger.getLogger(this.getClass());
	
	/**
	 * 查询询盘信息列表
	 * @param pageSize
	 * @param pageNum
	 * @param cinfo
	 * @return
	 * @throws BusinessException
	 */
	public DisplayPage getSearchDiskList(int pageSize, int pageNum, CriteriaInfo cinfo) throws BusinessException {
		Log.info("search page " + pageNum);
		DisplayPage page = PageManager.getDisplayPage(pageSize, pageNum, cinfo);
		return page;
	}
	
	
	
	/**
	 * 删除询盘信息
	 * @param id
	 * @throws BusinessException
	 */
	public void deleteSearchDisk(Long id) throws BusinessException {
		Searchdisk p = (Searchdisk) BaseHibernateDAO.findById(Searchdisk.class, id);
		BaseHibernateDAO.delete(p);
	}
	
	
	/**
	 * 按照Id查询询盘对象
	 * @param id
	 * @return
	 * @throws BusinessException
	 */
	public Searchdisk findDiskById(Long id) throws BusinessException{
		Searchdisk obj = (Searchdisk)BaseHibernateDAO.findById(Searchdisk.class,id);
		
		return obj;
	}
	
	
	
}
